package bodyAngle;

import java.util.Hashtable;

/**
 * Stores angles of different body parts so they may be updated easily
 * @author norrielm
 *
 */
public class AngleStorage {

	private Hashtable<String, Angle> bodyAngles;
	
	public AngleStorage(){
		bodyAngles = new Hashtable<String,Angle>();
	}
	
	public void addBodyPlace(Angle a, String bodyPlace){
		bodyAngles.put(bodyPlace, a);
	}
	public void addBodyPlace(String bodyPlace){
		bodyAngles.put(bodyPlace, new Angle(bodyPlace));
	}
	
	public Angle getBodyAngle(String bodyPlace){
		return bodyAngles.get(bodyPlace);
	}
	
	public String toString(){
		String s = "";
		
		for(String key:bodyAngles.keySet()){
			s += bodyAngles.get(key) + ";";
		}
		
		return s;
	}
	
}
